package visiopuce.graph;

import org.jfree.chart.labels.StandardXYToolTipGenerator;
import org.jfree.chart.labels.XYItemLabelGenerator;
import org.jfree.data.xy.XYDataset;


public class BarToolTipGenerator extends StandardXYToolTipGenerator implements  XYItemLabelGenerator{

	/**
	 * 
	 */
	private static final long serialVersionUID = 3120285982566707171L;



	public String generateToolTip(XYDataset dataset, int series, int item) {
		String r = "";
		if ( dataset instanceof XYFloatingBarDataset){
			r = ((XYFloatingBarDataset) dataset).getToolTip(series, item);
		}
        StringBuilder toolTipHtml = new StringBuilder();
        toolTipHtml.append("<html><body>");
    //    toolTipHtml.append("<span  style='color: #000000;padding: 0.1em 0.1em;font-family: Calibri, Tahoma,  Geneva, sans-serif;font-size: 12pt;' />");
        toolTipHtml.append(r);
        toolTipHtml.append("</body></html>");
        return toolTipHtml.toString();
	}


	public String generateLabelString(XYDataset dataset, int series, int item) {
		String r = "";
		if ( dataset instanceof XYFloatingBarDataset){
			r = ((XYFloatingBarDataset) dataset).getLabel(series, item);
		}
		return r;
	}

	public String generateLabel(XYDataset dataset, int series, int item) {
		String r = "";
		if ( dataset instanceof XYFloatingBarDataset){
			r = ((XYFloatingBarDataset) dataset).getLabel(series, item);
		}
		return r;
	}

	

}
